﻿
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Diagnostics;

namespace TextFlow.Activities
{
	public class TextFlowWorkflow : SequentialWorkflowActivity
	{
        private Dictionary<string,object> _operands = new Dictionary<string,object>();

		public TextFlowWorkflow()
		{
		}

        public TextFlowWorkflow( string name ) : base( name )
        {
        }

        public Dictionary<string,object> Operands
        {
            get { return _operands; }
        }

        public T Lookup<T>( string identifier )
        {
            if ( string.IsNullOrEmpty( identifier ) )
            {
                throw new ArgumentNullException( "identifier" );
            }

            Debug.Assert( Operands != null );

            return (T) Operands[ identifier ];
        }
	}
}
